package com.ppc.ugo.controller;

import com.ppc.ugo.common.cache.Cache;
import com.ppc.ugo.common.log.LogAnnotation;
import com.ppc.ugo.service.CategoryService;
import com.ppc.ugo.vo.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/api/public/v1")
public class CategoryController {
    @Autowired
    private CategoryService categoryService;

    @GetMapping("categories")
    @LogAnnotation(module = "分类", operation = "获取所有分类列表数据")
    @Cache(name = "Categories", expire = 5 * 60 * 1000)
    public Result getCategories(){
        return categoryService.getCategories();
    }

}
